# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: 
pkgname=ocaml-obytelib
_pkgname=obytelib
pkgver=1.6
pkgrel=0
pkgdesc="OCaml bytecode library tools to read, write and evaluate OCaml bytecode files"
url="https://github.com/bvaugon/obytelib"
arch="all !riscv64" # restricted by ocaml
license="CeCILL-2.0"
depends="ocaml-runtime"
makedepends="bash ocaml ocamlbuild cmd:ocamldoc"
options="!check"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/bvaugon/obytelib/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

# 32-bit archs
case "$CARCH" in
	arm*|x86) options="$options textrels" ;;
esac

build() {
	./configure \
		-prefix "$pkgdir"/usr \
		-libdir "$pkgdir"/usr/lib/ocaml/"$_pkgname" \
		-mandir "$pkgdir"/usr/share/man
	make
}

package() {
	make install
}

sha512sums="
570cb52ccc395074e39743fa3c0b18043abc3da3f0cfd3d3871ffe56b390f37baf66c646a2341f03ff892feb98147e5cfcc6374b8658071649e32f86c84898e4  ocaml-obytelib-1.6.tar.gz
"
